package cn.com.zhuxulin.android.demos.bussiness;

import android.location.Location;
import android.os.Bundle;

public class LocationInfo {
	private Location loc = null;
	private float accuracy;
	private float bearing;
	private double altitude;
	private double latitude;
	private Bundle extras;
	private double longitude;
	private float speed;
	private String provider;
	private long time;

	public LocationInfo(Location loc) {
		this.loc = loc;
		setInfo();
	}

	private void setInfo() {
		accuracy = loc.getAccuracy();
		altitude = loc.getAltitude();
		bearing = loc.getBearing();
		extras = loc.getExtras();
		latitude = loc.getLatitude();
		longitude = loc.getLongitude();
		provider = loc.getProvider();
		speed = loc.getSpeed();
		time = loc.getTime();
	}

	public String getInfo() {
		return "LocationInfo: \nloc=" + loc + "\n accuracy=" + accuracy
				+ "\n bearing=" + bearing + "\n altitude=" + altitude
				+ "\n latitude=" + latitude + "\n extras=" + extras
				+ "\n longitude=" + longitude + "\n speed=" + speed
				+ "\n provider=" + provider + "\n time=" + time;
	}
}
